﻿using System.Collections;
using System.Collections.Generic;

namespace CoreLibrary.Template {

    public class TemplateParameters : IEnumerable<KeyValuePair<string, object>> {

        private readonly Dictionary<string, object> _maps  = new Dictionary<string, object>();

        public object this[string key] {
            get { return Get(key); }
            set { Put(key, value); }
        }

        public object Get(string key) {
            object result;
            if (_maps.TryGetValue(key, out result)) {
                return result;
            }
            return null; 
        }

        public void Put(string key, object value) {
            _maps[key] = value;
        }

        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() {
            return _maps.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator() {
            return GetEnumerator();
        }

    }

}